--       _________ __                 __                               
--      /   _____//  |_____________ _/  |______     ____  __ __  ______
--      \_____  \\   __\_  __ \__  \\   __\__  \   / ___\|  |  \/  ___/
--      /        \|  |  |  | \// __ \|  |  / __ \_/ /_/  >  |  /\___ \ 
--     /_______  /|__|  |__|  (____  /__| (____  /\___  /|____//____  >
--             \/                  \/          \//_____/            \/ 
--  ______________________                           ______________________
--			  T H E   W A R   B E G I N S
--	   Stratagus - A free fantasy real time strategy game engine

--      anim.lua - Animations
--
--      (c) Copyright 2005 by David Stone
--
--      This program is free software; you can redistribute it and/or modify
--      it under the terms of the GNU General Public License as published by
--      the Free Software Foundation; either version 2 of the License, or
--      (at your option) any later version.
--
--      This program is distributed in the hope that it will be useful,
--      but WITHOUT ANY WARRANTY; without even the implied warranty of
--      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
--      GNU General Public License for more details.
--
--      You should have received a copy of the GNU General Public License
--      along with this program; if not, write to the Free Software
--      Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA



DefineAnimations("animations-tank", {
	Still = {
		"frame 0", "wait 2", "goto unbreakable",
		"label unbreakable", "wait 20",
			"frame 0", "wait 2", "frame 0", "random-goto 1 rotate1",
	    	"random-goto 1 move1", "goto end",
			"label rotate1",  "random-goto 40 rotate2", "goto end",
			"label rotate2", "random-rotate 1", "goto end",
			"label move1", "random-goto 20 move2", "goto end",
			"label move2", "frame 5", "wait 2", "frame 10", "wait 2", "frame 15", "wait 2", "goto end",
			"frame 40","goto end",
        	"label end", "wait 1", "goto unbreakable"},
	Move = {"unbreakable begin", 
	"frame 5", "move 4", "wait 1",
	"frame 0", "move 5", "wait 2",
	"frame 10", "move 5", "wait 1",
	"frame 15", "move 4", "wait 2",
	"frame 20",	"move 5", "wait 1",
	"frame 25", "move 5", "wait 2",
	"frame 30", "move 4", "wait 2",
	"unbreakable end",	"wait 1"},
	Attack = {"unbreakable begin",
	"frame 35", "wait 3",
	"frame 40", "wait 4", "sound big cannon",
	"frame 45", "attack", "wait 4",
	"frame 0", "wait 1",
	"unbreakable end", "wait 13"},
	Build = {"unbreakable begin",
	"frame 35", "wait 3",
	"frame 40", "wait 4",
	"frame 5", "attack", "wait 4",
	"frame 0", "wait 1",
	"wait 13", "unbreakable end", "wait 3"},
	Repair = {"unbreakable begin",
	"frame 35", "wait 3",
	"frame 40", "wait 4",
	"frame 45", "wait 4",
	"frame 0", "wait 1",
	"unbreakable end", "wait 4"},
	--[[Death = {"frame 0", "wait 100"}--]]} )
	
DefineAnimations("animations-inf", {
	Still = {"frame 5", "wait 4", "frame 5", "random-goto 1 rotate1", "random-goto 1 attack1", 
	        "random-goto 1 move1", "goto end",
		"label rotate1",  "random-goto 40 rotate2", "goto end",
		"label rotate2", "random-rotate 1", "goto end",
		"label move1", "random-goto 20 move2", "goto end",
		"label move2", "frame 10", "wait 2", "frame 15", "wait 2", "frame 20", "wait 2", "goto end",
		"label attack1", "random-goto 20 attack2", "goto end",
		"label attack2", "frame 40", "wait 3", "frame 45", "wait 3", "frame 40", "wait 3", 
		"frame 40","goto end",
        	"label end", "wait 1"},
	Move = {"unbreakable begin", 
		"frame 0", "move 2", "random-wait 1 2",
		"frame 0", "move 1", "random-wait 1 2",
		"frame 5", "move 2", "random-wait 1 2", 
		"frame 5", "move 2", "random-wait 1 2",
		"frame 10", "move 2", "random-wait 1 2", 
		"frame 10", "move 1", "random-wait 1 2", 
		"frame 15", "move 2", "random-wait 1 2", 
		"frame 15", "move 1", "wait 1 ", 
		"frame 20", "move 2", "random-wait 1 2", 
		"frame 20", "move 1", "random-wait 1 2", 
		"frame 25", "move 2", "random-wait 1 2", 
		"frame 25", "move 1", "random-wait 1 2",
		"frame 30", "move 2", "random-wait 1 2",
		"frame 30", "move 2", "random-wait 1 2",
		"frame 35", "move 1", "wait 1 ",
		"frame 35", "move 1", "random-wait 1 2",
		"frame 40", "move 2", "random-wait 1 2",
		"frame 40", "move 2", "random-wait 1 2",
		"frame 45", "move 1", "wait 1",
		"frame 45", "move 2", "random-wait 1 2",
		
		"unbreakable end", "wait 1"},
	Attack = {"unbreakable begin",
		"frame 50", "random-wait 1 3", 
		"frame 55", "random-wait 2 3", 
		"frame 60", "random-wait 3 4", 
		"frame 65", "wait 1",
		"frame 70", "wait 1",
		"frame 75", "sound inf", "attack", "wait 1", 
		"frame 80", "wait 1",
		"frame 35", "wait 1", 
		"unbreakable end",
		"wait 10"},
	Repair = {"unbreakable begin",
		"frame 35", "random-wait 1 3", 
		"frame 40", "random-wait 2 3", 
		"frame 45", "random-wait 3 4", 
		"frame 45", "wait 5", 
		"frame 35", "wait 10", 
		"unbreakable end", "wait 1"},
	Build = {"unbreakable begin",
		"frame 0", "wait 1", 
		"frame 5", "wait 1", 
		"frame 10", "wait 1",
		"frame 15", "wait 1", 
		"frame 20", "wait 1", 
		"frame 25", "wait 1", 
		"frame 30", "wait 1", 
		"frame 35", "wait 1", 
		"frame 40", "wait 1", 		
		"frame 50", "wait 5",
		"frame 55", "wait 10",
		"frame 95", "wait 5",
		"frame 100", "wait 15",
		"unbreakable end",  "attack","wait 1"},		
	--[[Death = {"frame 50", "wait 50"}--]]})
	
DefineAnimations("animations-inf-dug", {
	--[[Still = {"frame 5", "wait 4", "frame 5", "random-goto 1 rotate1", "random-goto 1 attack1", 
	        "random-goto 1 move1", "goto end",
		"label rotate1",  "random-goto 40 rotate2", "goto end",
		"label rotate2", "random-rotate 1", "goto end",
		"label move1", "random-goto 20 move2", "goto end",
		"label move2", "frame 10", "wait 2", "frame 15", "wait 2", "frame 20", "wait 2", "goto end",
		"label attack1", "random-goto 20 attack2", "goto end",
		"label attack2", "frame 40", "wait 3", "frame 45", "wait 3", "frame 40", "wait 3", 
		"frame 40","goto end",
        	"label end", "wait 1"},--]]
	Still = {"frame 90", "wait 15", "random-goto 1 rotate", "goto end",
			 "label rotate", "random-rotate 1", "wait 15", "goto end",
			 "label end", "wait 15"},
	Attack = {"unbreakable begin",
		"frame 100", "random-wait 1 3", 
		"frame 105", "random-wait 2 3", 
		"frame 110", "random-wait 3 4", 
		"frame 115", "wait 2",
		"frame 120", "sound inf", "attack", "wait 1", 
		"frame 115", "wait 1",
		"frame 100", "wait 1", 
		"unbreakable end",
		"wait 10"},
	Build = {"unbreakable begin",
		"frame 35", "random-wait 1 3", 
		"frame 40", "random-wait 2 3", 
		"frame 45", "random-wait 3 4", 
		"frame 45", "wait 5", 
		"frame 35", "wait 10", 
		"unbreakable end",  "attack","wait 1"},		
	--[[Death = {"frame 50", "wait 50"}--]]})
	
DefineAnimations("animations-fighter", {
	Still = {"frame 0", "wait 1",
		"frame 5", "wait 1", 
		"frame 10", "wait 1", 
		"frame 15", "wait 1", 
		"random-goto 2 rotate2", "goto end",
		"label rotate2", "random-rotate 1", "goto end",
		"label end"},
	Move = {"unbreakable begin", 
		"frame 0", "move 8", "wait 1",
		"frame 5", "move 8", "random-wait 1 2",
		"frame 10", "move 8", "wait 1",
		"frame 15", "move 8", "random-wait 1 2",
		"unbreakable end", "wait 1"},
	Attack = {"unbreakable begin",
		"frame 20", "wait 1", 
		"frame 25", "wait 1", 
		"frame 20", "wait 1", 
		"frame 20", "wait 1", "sound machinegun",
		"frame 25", "attack", "wait 2",
		"frame 20", "wait 1", 
		"frame 20", "wait 1",
		"frame 25", "wait 1",
		"frame 20", "wait 1",		
		"unbreakable end", "wait 12"},
		Harvest_gas = {
		"frame 0", "wait 25",},
	--[[Death = {"unbreakable begin",
		"exact-frame 0", "wait 1",
		"exact-frame 1", "wait 1",
		"exact-frame 2", "wait 1",
		"exact-frame 28", "wait 1",
		"exact-frame 29", "wait 1",
		"unbreakable end", "wait 1"}--]] } )
		
DefineAnimations("animations-bomber", {
	Still = {"frame 0", "wait 1",
		"frame 5", "wait 1",
		"frame 10", "wait 1",
		"frame 15", "wait 1",
		"random-goto 1 rotate2", "goto end",
		"label rotate2", "random-rotate 1", "goto end",
		"label end"},
	Move = {"unbreakable begin", 
		"frame 0", "move 8", "wait 1",
		"frame 5", "move 8", "wait 1",
		"frame 10", "move 8", "wait 1",
		"frame 15", "move 8", "wait 1",
		"unbreakable end", "wait 1"},
	Attack = {"unbreakable begin",
		"frame 10", "wait 2",
		"frame 15", "attack", "wait 5",
		"frame 10", "wait 2",
		"unbreakable end", "wait 13"},
	Harvest_gas = {
		"frame 0", "wait 25",},
	--[[Death = {"unbreakable begin",
		"exact-frame 0", "wait 1",
		"exact-frame 1", "wait 1",
		"exact-frame 2", "wait 1",
		"exact-frame 18", "wait 1",
		"exact-frame 19", "wait 1",
		"unbreakable end", "wait 1"}--]] } )		
		
DefineAnimations("animations-battleship", {
	Still = {"frame 0", "wait 4",
		"random-goto 1 rotate2", "goto end",
		"label rotate2", "random-rotate 1", "goto end",
		"label end"},
	Move = {"unbreakable begin", 
		"frame 0", "move 4", "wait 1",
		"frame 0", "move 5", "wait 2",
		"frame 0", "move 5", "wait 1",
		"frame 0", "move 4", "wait 2",
		"frame 0", "move 5", "wait 1",
		"frame 0", "move 5", "wait 2",
		"frame 0", "move 4", "wait 2",
		"unbreakable end",	"wait 1"},
	Attack = {"unbreakable begin",
		"frame 5", "wait 1",
		"frame 10", "wait 1",
		"frame 15", "wait 1",
		"frame 20", "wait 1",
		"frame 25", "wait 1", "attack",
		"frame 30", "wait 1",
		"frame 35", "wait 1",
		"frame 0", "wait 1",
		"unbreakable end", "wait 14"},
	--[[Death = {"unbreakable begin",
		"exact-frame 0", "wait 1",
		"exact-frame 1", "wait 1",
		"exact-frame 2", "wait 1",
		"exact-frame 18", "wait 1",
		"exact-frame 19", "wait 1",
		"unbreakable end", "wait 1"}--]] } )		
		
DefineAnimations("animations-aa", {
	Still = {"frame 0", "wait 4",
		"frame 0", "wait 1"},
	Attack = {"unbreakable begin", 
		"frame 0", "wait 1",
		"frame 5", "wait 2",
		"frame 10", "wait 3", "attack",
		"frame 15", "wait 2",
		"unbreakable end", "wait 14"},
	Build = {"frame 0", "wait 4",
		"frame 0", "wait 1"} } )

DefineAnimations("animations-sub", {
	Still = {"frame 0", "wait 4",
		"random-goto 1 rotate2", "goto end",
		"label rotate2", "random-rotate 1", "goto end",
		"label end"},
	Move = {"unbreakable begin", 
		"frame 0", "move 4", "wait 1",
		"frame 0", "move 5", "wait 2",
		"frame 0", "move 5", "wait 1",
		"frame 0", "move 4", "wait 2",
		"frame 0", "move 5", "wait 1",
		"frame 0", "move 5", "wait 2",
		"frame 0", "move 4", "wait 2",
		"unbreakable end",	"wait 1"},
	Attack = {"unbreakable begin",
		"frame 0", "wait 1",
		"frame 0", "wait 1",
		"frame 0", "wait 1",
		"frame 0", "wait 1",
		"frame 0", "wait 1", "attack",
		"frame 0", "wait 1",
		"frame 0", "wait 1",
		"frame 0", "wait 1",
		"unbreakable end", "wait 14"},
	Build = {"unbreakable begin",
		"frame 0", "wait 1",
		"frame 0", "wait 1",
		"frame 0", "wait 1",
		"frame 0", "wait 1",
		"frame 0", "wait 1", 
		"frame 0", "wait 1",
		"frame 0", "wait 1",
		"frame 0", "wait 1",
		"unbreakable end",  "attack", "wait 14"},
	--[[Death = {"unbreakable begin", -- for some reason the death animation
		"exact-frame 0", "wait 1",    -- causes network desync to happen if a sub
		"exact-frame 1", "wait 1",	  -- merges and submerges several times than
		"exact-frame 2", "wait 1",	  -- dies.
		"exact-frame 18", "wait 1",
		"exact-frame 19", "wait 1",
		"unbreakable end", "wait 1"}--]] } )		

DefineAnimations("animations-carrier", {
	Still = {"frame 0", "wait 4",
		"random-goto 1 rotate2", "goto end",
		"label rotate2", "random-rotate 1", "goto end",
		"label end"},
	Move = {"unbreakable begin", 
		"frame 0", "move 4", "wait 1",
		"frame 0", "move 5", "wait 2",
		"frame 0", "move 5", "wait 1",
		"frame 0", "move 4", "wait 2",
		"frame 0", "move 5", "wait 1",
		"frame 0", "move 5", "wait 2",
		"frame 0", "move 4", "wait 2",
		"unbreakable end",	"wait 1"},
	Attack = {"unbreakable begin",
		"frame 0", "wait 1",
		"frame 0", "wait 1",
		"frame 0", "wait 1",
		"frame 0", "wait 1",
		"frame 0", "wait 1", "attack",
		"frame 0", "wait 1",
		"frame 0", "wait 1",
		"frame 0", "wait 1",
		"unbreakable end", "wait 14"},
	--[[Death = {"unbreakable begin",
		"exact-frame 0", "wait 1",
		"exact-frame 1", "wait 1",
		"exact-frame 2", "wait 1",
		"exact-frame 18", "wait 1",
		"exact-frame 19", "wait 1",
		"unbreakable end", "wait 1"}--]] } )
		
DefineAnimations("animations-boat", {
Still = {"frame 0", "wait 5",
	"frame 0", "wait 5"},
Move = {"unbreakable begin",
	"frame 0", "move 4", "wait 2",
	"frame 0", "move 3", "wait 2",
	"frame 0", "move 3", "wait 2",
	"frame 0", "move 4", "wait 2",
	"frame 0", "move 4", "wait 2",
	"frame 0", "move 3", "wait 2",
	"frame 0", "move 4", "wait 2",
	"frame 0", "move 4", "wait 2",
	"frame 0", "move 3", "wait 1",
	"unbreakable end", "wait 1"},
--[[Death = {"unbreakable begin",
	"frame 0", "wait 50",
	"frame 0", "wait 1",
	"unbreakable end", "wait 50"}--]]
})


DefineAnimations("animations-building", {
	Still = {"frame 0", "wait 4",
		"frame 0", "wait 1"},
	Build = {"frame 0", "wait 4",
		"frame 0", "wait 1"}})
